﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ReadyApps.Wiki;

namespace ReadyAppsTest.Wiki
{
    class TestWikiSecurityManager : IWikiSecurityManager
    {
        #region Driving Data

        public bool WikiPageModeAuthorized { get; set; }

        #endregion

        #region Method Call Parameter Values

        public bool DeterminePagePermissions_securityIsEnabled { get; private set; }
        public int DeterminePagePermissions_pageID { get; private set; }
        public bool DetermineFolderPermissions_securityEnabled { get; private set; }
        public int DetermineFolderPermissions_folderID { get; private set; }
        public WikiPageMode IsWikiPageModeAuthorized_pageMode { get; private set; }
        public string IsSameUser_username { get; private set; }

        #endregion

        #region Method Return Values

        public bool IsSameUser_ReturnValue { get; set; }

        #endregion

        #region Interface Members

        public bool IsUserAuthenticated { get; set; }

        public string CurrentUsername { get; set; }

        public bool CanEditPage { get; set; }

        public bool CanCreatePage { get; set; }

        public bool CanCreateFolder { get; set; }

        public bool CanEditPermissions { get; set; }

        public bool CanManageRevisions { get; set; }

        public bool CanManagePublishing { get; set; }

        public bool CanViewPage { get; set; }

        public bool CanEditSettings { get; set; }

        public void DeterminePagePermissions(bool securityIsEnabled, int pageID)
        {
            DeterminePagePermissions_securityIsEnabled = securityIsEnabled;
            DeterminePagePermissions_pageID = pageID;
        }

        public void DetermineFolderPermissions(bool securityIsEnabled, int folderID)
        {
            DetermineFolderPermissions_securityEnabled = securityIsEnabled;
            DetermineFolderPermissions_folderID = folderID;
        }

        public bool IsWikiPageModeAuthorized(WikiPageMode pageMode)
        {
            IsWikiPageModeAuthorized_pageMode = pageMode;
            return WikiPageModeAuthorized;
        }

        public bool IsSameUser(string username)
        {
            IsSameUser_username = username;
            return IsSameUser_ReturnValue;
        }

        #endregion
    }
}
